package com.yzy.fly.entity.role;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yzy.fly.util.DateUtil;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@TableName("fly_def_model")
public class FlyDefModel implements Serializable{
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String name;
    private Integer parentId;
//    private Integer parentFieldId;
//    private String parentFieldName;
    private Integer systemId;

    @TableField(exist=false)
    private boolean open=true;
    @TableField(exist=false)
    private List<FlyDefModel> childrens;

    @DateTimeFormat(pattern= DateUtil.DateFormatPattern.yyyy_MM_dd_HH_mm_ss)
    @JsonFormat( pattern = DateUtil.DateFormatPattern.yyyy_MM_dd_HH_mm_ss )
    private Date createTime;
    @DateTimeFormat(pattern= DateUtil.DateFormatPattern.yyyy_MM_dd_HH_mm_ss)
    @JsonFormat( pattern = DateUtil.DateFormatPattern.yyyy_MM_dd_HH_mm_ss )
    private Date updateTime;

    /**
     * 方法说明:获取实体类名称
     */
//    public String getEntityClazz() {
//        int index = classPath.lastIndexOf('.');
//        return classPath.substring(index + 1);
//    }
}
